<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSmsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sms', function (Blueprint $table) {
            $table->increments('id')->comment('短信验证码表');
            $table->string('event', 255)->nullable()->comment('短信事件');
            $table->string('mobile', 32)->nullable()->comment('手机号');
            $table->string('code', 32)->nullable()->comment('验证码');
            $table->string('ip', 32)->nullable()->comment('ip地址');
            $table->tinyInteger('status')->nullable()->comment('使用状态（0待使用；1已使用）')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sms');
    }
}
